<%@ page import="java.sql.*" contentType="text/html;charset=windows-1252"%>
<%
  //in:category,name,author,related tool
  //out:article id,article name,author
 int toolId=Integer.parseInt(request.getParameter("ID"));

 //making connection
   Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
   String url = "jdbc:odbc:iranhk";
   Connection con = DriverManager.getConnection(url, "iranhk", "iranhk");

 //get result of search 
 PreparedStatement pst=con.prepareStatement(
      "select tb_articles.id,tb_articles.name,tb_members.id authorid ,tb_members.name author "+ 
      "from tb_articles,tb_members,tb_tools "+
      "where "+
         "(tb_articles.fk_author_id=tb_members.id) and "+         
         "(tb_articles.fk_rel_tool=tb_tools.id) and "+
         "(tb_articles.fk_rel_tool=?) "+
      "order by tb_articles.dat;"
  );
  pst.setInt(1,toolId);
  ResultSet rst=pst.executeQuery();    
  session.setAttribute("resultSet",rst);
     //out.print(pst.toString());
    /* while (rst.next()){ 
      out.print(rst.getString("NAME"));
    }*/
%>

<jsp:include page="../displayer/articles.jsp" flush="true">
  <jsp:param name="" value=""/>
</jsp:include> 